package com.hzyb.shopPopAds.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hzyb.shopPopAds.service.ShopPopAdsService;

@RestController
@RequestMapping("/ads")
public class ShopPopAdsController {

	@Resource
	private ShopPopAdsService shopPopAdsService;


	private Logger logger=LoggerFactory.getLogger(ShopPopAdsController.class);

	@RequestMapping("/getShopPopAds")
	public Map<String, Object> getShopPopAds(@RequestParam String adsType){
		Map<String, Object> map=new HashMap<>();
		map.put("status", "fail");
		try {
			map.put("data",shopPopAdsService.getShopPopAds(adsType));
			map.put("status", "success");
		} catch (Exception e) {
			logger.error(e.toString());
		}
		return map;
	}
}
